package com.seuic.hnjiningposapp.hnapps.ui.view.dialog;

import android.content.Context;
import android.widget.Button;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.lxj.xpopup.core.BasePopupView;
import com.seuic.hnjiningposapp.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * 口头挂失成功
 */
public class LossSuccesPp extends BasePopupView {
    Unbinder bind;
    @BindView(R.id.success_num)
    TextView successNum;
    @BindView(R.id.success_usernam)
    TextView successUsernam;
    @BindView(R.id.success_ok_btn)
    Button successOkBtn;
    LossSuccessCallBack mLossSuccessCallBack;

    public LossSuccesPp(@NonNull Context context, LossSuccessCallBack lossSuccessCallBack) {
        super(context);
        this.mLossSuccessCallBack = lossSuccessCallBack;
    }

    String num;
    String username;

    public void setNum(String num) {
        this.num = num;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Override
    protected void onCreate() {
        super.onCreate();
        bind = ButterKnife.bind(this);
        successNum.setText(num);
        successUsernam.setText(username);

    }

    @Override
    protected void onDismiss() {
        super.onDismiss();
        //注解解绑
        if (bind != null && bind != Unbinder.EMPTY) {
            bind.unbind();
        }
        this.bind = null;
    }

    @Override
    protected int getPopupLayoutId() {
        return R.layout.loss_succes_pp;
    }

    @OnClick(R.id.success_ok_btn)
    public void onViewClicked() {
        mLossSuccessCallBack.onSucessCallBack();
    }

    public interface LossSuccessCallBack {
        void onSucessCallBack();
    }
}
